#ifndef HARDWAREPROFILE_C
#define HARDWAREPROFILE_C

#include "HardwareProfile.h"
#include "GenericTypeDefs.h"
#include <p18cxxx.h>
void configureLeds(void);
void configureSwitchs(void);

void configureBoard() {
    configureLeds();
    configureSwitchs();
}

void configureLeds() {
    TRISCbits.TRISC0 = OUTPUT_PIN;
    TRISCbits.TRISC1 = OUTPUT_PIN;

    led(0,CLEAR);
    led(1,CLEAR);
}

void configureSwitchs() {
    TRISCbits.TRISC2 = INPUT_PIN;
}

/**
 * Set the light of the led number ledId when light is  true
 * @param ledId unsigned char
 * @param light Light
 */
void led(unsigned char ledId, Light light) {
    if (ledId == 0u) {
        led0( light);
    }
    if (ledId == 1u) {
        led1( light);
    }
}

void led0(Light light) {
    LED_0 = light;
}

void led1(Light light) {
    LED_1 = light;
}


void toggleLed0() {
    LED_0 = !LED_0;
}

void toggleLed1() {
    LED_1 = !LED_1;
}

void toggleUSBled() {
    toggleLed1();
}

